/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vzone;

import java.net.ServerSocket;
import java.net.Socket;

/**
 *服务工厂 为每个Socket请求启动一个新的线程
 * @author Kingpro
 */
public class VzoneFactory
{

    public boolean StartB = false;
    ServerSocket server;

    /**
     * 构造函数
     */
    public VzoneFactory()
    {
    }

    /**
     * 启动ServerSocket
     * 多线程处理Socket
     */
    public void StartServer()
    {
	try
	{
	    server = new ServerSocket(21118);
	    while (StartB)
	    {
		Socket socket = server.accept();
		new VzoneWorker(socket).start();

	    }
	}
	catch (Exception e)
	{
	}
    }
}
